package com.sandasai.action.user;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.sandasai.service.UserManager;
@Controller
@Scope("prototype")
public class ActiveAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Resource
	UserManager userManager;
	
	private String activeCode;
	
	private String username;

	public String getActiveCode() {
		return activeCode;
	}

	public void setActiveCode(String activeCode) {
		this.activeCode = activeCode;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	@Override
	public String execute() throws Exception{
		if(userManager.activeAccount(username, activeCode)) {
			return SUCCESS;
		}else {
			return ERROR;
		}
	}

}
